package com.ldu.exam.model;

import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.UpdateTimestamp;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 提交批改的试卷
 * @author wenqing.liu
 *
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Builder
@Table(name="t_submitpaper")
public class SubmitPaper 
{
	@Id
	@Column(length=32)
	@GeneratedValue(strategy = GenerationType.IDENTITY,generator = "jpa-uuid")
	@GenericGenerator(name = "jpa-uuid",strategy = "uuid.hex")
	private String id;
	
	/**
	 * 交卷人
	 */
	private String accountId;
	
	@Transient
	private String accountName;
	
	private String score;
	
	/**
	 * 是否批改(0未批改1正在批改2批改完成)
	 */
	private String isCorrected;
	
	private String paperName;
	
	/**
	 * 及格分数
	 */
	private String passedScore;
	/**
	 * 批卷日期
	 */
	@UpdateTimestamp
	private Date updateDate;
	
	@OneToMany
	private Set<SubmitQuestion> questions;
}
